home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 319 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.8 KB  |  38 lines

  1. Newsgroups: comp.lang.c,comp.std.c
  2. Path: nntp.coast.net!torn!sq!msb
  3. From: msb@sq.com (Mark Brader)
  4. Subject: Re: Integral conversion e.t.c. (was: Re: Hungarian notation)
  5. Message-ID: <1996Feb7.185509.10227@sq.com>
  6. Organization: SoftQuad Inc., Toronto, Canada
  7. References: <30C40F77.53B5@swsbbs.com> <SPENCER.96Jan22113215@zorgon.ERA.COM> <KANZE.96Feb5133404@slsvewt.lts.sel.alcatel.de> <823699045snz@genesis.demon.co.uk>
  8. Date: Wed, 7 Feb 1996 18:55:09 GMT
  9.  
  10. > I'm not quite clear on the intention of the standard here. As a
  11. > categorisation of types of error it is useful to distinguish between
  12. > errors that require a diagnostic and plain undefined behaviour. However
  13. > when a diagnostic is required clearly the result is undefined behaviour.
  14. > 3.16 Undefined behaviour
  15. > "Behaviour, upon use of a nonportable or erroneous program construct"
  16. > "... or by the omission of any explicit definition of behaviour"
  17. > These would seem to cover syntax errors and constraint violations.
  18.  
  19. Are there really official copies of the standard that spell it "behaviour"?
  20. Just curious.
  21.  
  22. Yes, it is correct that when a diagnostic is required, the behavior is
  23. otherwise undefined.  To avoid any confusion: the undefined behavior
  24. cannot extend to omitting the diagnostic.  This was made explicit in
  25. Technical Corrigendum 1, which changed the first sentence of 5.1.1.3 to:
  26.  
  27. #  A conforming implementation shall produce at least one
  28. #  diagnostic message (identified in an implementation-defined
  29. #  manner) for every translation unit that contains a violation
  30. #  of any syntax rule or constraint, even if the behavior is also
  31. #  explicitly specified as undefined or implementation-defined.
  32. -- 
  33. Mark Brader, msb@sq.com | "However, 0.02283% failure might be better than 50%
  34. SoftQuad Inc., Toronto  |  failure, depending on your needs." -- Norman Diamond
  35.  
  36. My text in this article is in the public domain.
  37.